{% extends 'mobile/base.html' %}
{% load static from staticfiles %}

{% block mainbody %}
<!--头部-->
<header>
    <div class="header">
        <h1>登录</h1>
        <a href="#" class="return"><i></i></a>
    </div>
</header>

<!--内容区-->
<article class="main-container loginContent">
<form action="{% url 'mobile_doregister' %}" method="post">
	{% csrf_token %}
	<div class="list">
        <ul class="line">
            <li><i class="icon-head"></i><input type="text" name="mobile" id="name" placeholder="手机号码"></li>
            <li class="code"><i class="icon-sms"></i><input name="code" type="tel" id="code" placeholder="手机收到的校验码"><button>点击获取</button></li>
        </ul>
    </div>
    
    <div class="button"><button type="submit">快速登录</button></div>
</form>
	<div style="text-align:center;padding:10px;">测试验证码：1234</div>
    <div style="text-align:center;padding:10px;color: #f00;">{{info}}</div>
</article>

{% endblock %}

{% block myjavascript %}
<script type="text/javascript">
	$("button:contains('点击获取')").click(function(){
		bt = $(this);
		if(bt.html() != "点击获取"){
			return;
		}
		var phone = $("#name").val();
		//$.get();
		bt = $(this);
		var t=60;
		bt.html(t+"秒")
		var mytime = setInterval(function(){
			t= t-1;
			bt.html(t+"秒")
			if(t <= 0){
				clearInterval(mytime)
				bt.html("点击获取");
			}
		},1000);
		
	});
</script>
{% endblock %}